<!--{template "header"}-->
    <!--设置 Begin-->
	
<script>
function wechat_login(u, p) {
	showTipsExp("正在登录...");
	var postData = {
		'username':$('#'+u).val(),
		'password':$('#'+p).val(),
		'openid':$('#openid').val(),
	};
	var ajax = $.post (
		"index.php?mod=wechat&code=login",
		postData,
		function(r) { 
		
			if(r.done) {
					showTipsExp("绑定成功，正在跳转...", 1);
					var openid = $("#openid").val();
					setTimeout("location.href='{$this->Config['site_url']}/wap/index.php'", 1000);
			}else{
				showTipsExp(r.msg, 1);
			}
		},
		"json"
	);
}
</script>
    <div id="setting_wp" class="mc">
        <ul class="lv_4">
            <li>
                <div class="col2"><input name="nickname" type="text" id="nickname" value="昵称" class="login_txt" onFocus="this.value=''" onBlur="if(this.value==''){this.value='昵称';}" /></div>
            </li>
            <li class="nb">
                <div class="col2"><input name="password" type="password" id="password" value="密码" class="login_txt" onFocus="this.value=''" onBlur="if(this.value==''){this.value='密码';}"/></div>
            </li>
        </ul>
		<div class="loginbar">
			<input type="hidden" id="openid" name="openid" value="{$openid}">
    		<button class="btn_login" onclick="wechat_login('nickname', 'password')">登录</button>
    	</div> 	                                    
    </div>
